home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sysdeps / mach / hurd / i386 / sigcontext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-15  |  3.8 KB  |  106 lines

  1. /* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. /* Signal handlers are actually called:
  20.    void handler (int sig, int code, struct sigcontext *scp);  */
  21.  
  22. #include <mach/machine/fp_reg.h>
  23.  
  24. /* State of this thread when the signal was taken.  */
  25. struct sigcontext
  26.   {
  27.     /* These first members are machine-independent.  */
  28.  
  29.     int sc_onstack;        /* Nonzero if running on sigstack.  */
  30.     sigset_t sc_mask;        /* Blocked signals to restore.  */
  31.  
  32.     /* MiG reply port this thread is using.  */
  33.     unsigned int sc_reply_port;
  34.  
  35.     /* Port this thread is doing an interruptible RPC on.  */
  36.     unsigned int sc_intr_port;
  37.  
  38.     /* Error code associated with this signal (interpreted as `error_t').  */
  39.     int sc_error;
  40.  
  41.     /* All following members are machine-dependent.  The rest of this
  42.        structure is written to be laid out identically to:
  43.        {
  44.          struct i386_thread_state basic;
  45.          struct i386_float_state fpu;
  46.        }
  47.        trampoline.c knows this, so it must be changed if this changes.  */
  48.  
  49. #define sc_i386_thread_state sc_gs /* Beginning of correspondence.  */
  50.     /* Segment registers.  */
  51.     int sc_gs;
  52.     int sc_fs;
  53.     int sc_es;
  54.     int sc_ds;
  55.   
  56.     /* "General" registers.  These members are in the order that the i386
  57.        `pusha' and `popa' instructions use (`popa' ignores %esp).  */
  58.     int sc_edi;
  59.     int sc_esi;
  60.     int sc_ebp;
  61.     int sc_esp;            /* Not used; sc_uesp is used instead.  */
  62.     int sc_ebx;
  63.     int sc_edx;
  64.     int sc_ecx;
  65.     int sc_eax;
  66.   
  67.     int sc_eip;            /* Instruction pointer.  */
  68.     int sc_cs;            /* Code segment register.  */
  69.   
  70.     int sc_efl;            /* Processor flags.  */
  71.  
  72.     int sc_uesp;        /* This stack pointer is used.  */
  73.     int sc_ss;            /* Stack segment register.  */
  74.  
  75.     /* Following mimics struct i386_float_state.  Structures and symbolic
  76.        values can be found in <mach/i386/fp_reg.h>.  */
  77. #define sc_i386_float_state sc_fpkind
  78.     int sc_fpkind;        /* FP_NO, FP_387, etc.  */
  79.     int sc_fpused;        /* If zero, ignore rest of float state.  */
  80.     struct i386_fp_save sc_fpsave;
  81.     struct i386_fp_regs sc_fpregs;
  82.     int sc_fpexcsr;        /* FPSR including exception bits.  */
  83.   };
  84.  
  85.  
  86. /* Codes for SIGFPE.  */
  87. #define FPE_INTOVF_TRAP        0x1 /* integer overflow */
  88. #define FPE_INTDIV_FAULT    0x2 /* integer divide by zero */
  89. #define FPE_FLTOVF_FAULT    0x3 /* floating overflow */
  90. #define FPE_FLTDIV_FAULT    0x4 /* floating divide by zero */
  91. #define FPE_FLTUND_FAULT    0x5 /* floating underflow */
  92. #define FPE_SUBRNG_FAULT    0x7 /* BOUNDS instruction failed */
  93. #define FPE_FLTDNR_FAULT    0x8 /* denormalized operand */
  94. #define FPE_FLTINX_FAULT    0x9 /* floating loss of precision */
  95. #define FPE_EMERR_FAULT        0xa /* mysterious emulation error 33 */
  96. #define FPE_EMBND_FAULT        0xb /* emulation BOUNDS instruction failed */
  97.  
  98. /* Codes for SIGILL.  */
  99. #define ILL_INVOPR_FAULT    0x1 /* invalid operation */
  100. #define ILL_STACK_FAULT        0x2 /* fault on microkernel stack access */
  101. #define ILL_FPEOPR_FAULT    0x3 /* invalid floating operation */
  102.  
  103. /* Codes for SIGTRAP.  */
  104. #define DBG_SINGLE_TRAP        0x1 /* single step */
  105. #define DBG_BRKPNT_FAULT    0x2 /* breakpoint instruction */
  106.